package com.hnas.eCard.mapper;

import org.springframework.beans.BeanUtils;

import com.hnas.eCard.service.dto.DTOSaleCardOrder;
import com.hnas.eCard.service.dto.DTOSaleCardOrderDetail;
import com.hnas.trade.dto.DTOOrder;

public class SaleCardOrderMapper{
	private static SaleCardOrderMapper mapper;
	private SaleCardOrderMapper(){
		super();
	}
	public static SaleCardOrderMapper getInstance(){
		if(mapper == null){
			mapper = new SaleCardOrderMapper();
		}
		return mapper;
	}
	public static DTOOrder toOrder(DTOSaleCardOrder dto) {
		DTOOrder orderDto = new DTOOrder();
		BeanUtils.copyProperties(dto, orderDto);
		return orderDto;
	}
	public static DTOSaleCardOrderDetail toSaleCardOrderDetail(DTOSaleCardOrder dto) {
		DTOSaleCardOrderDetail detailDto = new DTOSaleCardOrderDetail();
		BeanUtils.copyProperties(dto, detailDto);
		return detailDto;
	}
	
	
}
